package com.bitoon.web.utils;

import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;

import com.opensymphony.xwork2.TextProvider;
import com.opensymphony.xwork2.util.ValueStack;

public class MyTextProvider implements TextProvider {

	@Override
	public String getText(String key) {
		return "override 1";
	}

	@Override
	public String getText(String key, List args) {
		return "override 2";
	}

	@Override
	public String getText(String key, String defaultValue) {
		return "override 3";
	}

	@Override
	public String getText(String key, String[] args) {
		return "override 4";
	}

	@Override
	public String getText(String key, String defaultValue, String obj) {
		return "override 7";
	}

	@Override
	public String getText(String key, String defaultValue, String[] args) {
		return "override 8";
	}

	@Override
	public String getText(String key, String defaultValue, String[] args,
			ValueStack stack) {
		return "override 9";
	}

	@Override
	public ResourceBundle getTexts() {
		Locale[] locales = new Locale[] { new Locale("fr", "FR"),
				new Locale("en", "IN") };
		ResourceBundle bundle = null;
		for (int i = 0; i < locales.length; i++) {
			bundle = ResourceBundle.getBundle("Resource", locales[i]);
		}
		return bundle;
	}

	@Override
	public ResourceBundle getTexts(String bundleName) {
		Locale[] locales = new Locale[] { new Locale("fr", "FR"),
				new Locale("en", "IN") };
		ResourceBundle bundle = null;
		for (int i = 0; i < locales.length; i++) {
			bundle = ResourceBundle.getBundle("Resource", locales[i]);
		}
		return bundle;
	}

	@Override
	public String getText(String arg0, String arg1, List arg2) {
		
		return "override 10";
	}

	@Override
	public String getText(String arg0, String arg1, List arg2, ValueStack arg3) {
		
		return "override 11";
	}

}
